Dynomotion

Group: DynoMotion Message: 3410 From: bradodarb Date: 1/24/2012
Subject: KM_Axis not updated
Anyone using the KM_Axis, the WaitforMotionComplete was not upadated from 4.28x to 4.28, you can use this code::

public bool WaitforMotionComplete(int timeout)
{
try
{
Stopwatch sw = new Stopwatch();
string value = "";
bool success = false;
int val = -1;
bool istimedout = false;
sw.Start();
while (val != 1)
{

value = _Controller.WriteLineReadLine(String.Format("CheckDone{0}", _ID));

success = Int32.TryParse(value, out val);
if (!success)
{
throw new Exception(String.Format("Bad return value for [CheckDone] function in axis {0} :: value = {1}", _Name, val));
}
if (timeout >= 0)//Determines whether or not to check for a timeout condition
{
if (timeout < sw.ElapsedMilliseconds)
{
istimedout = true;
break;
}
}
Thread.Sleep(30); //This should be optimized to make sure we do not clog USB traffic
}
return val == 1 & !istimedout;
}
catch (Exception ex)
{
throw new Exception(String.Format("Problem checking if axis is done [{0}]", _Name), ex);
}
}



-Brad Murry
Group: DynoMotion Message: 3411 From: himykabibble Date: 1/24/2012
Subject: Re: KM_Axis not updated
Will there be a v429 release soon? We've got this issue, the off-by-one bugs, the G-code path issue, the slow status updates on re-connect.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, "bradodarb" <bradodarb@...> wrote:
>
> Anyone using the KM_Axis, the WaitforMotionComplete was not upadated from 4.28x to 4.28, you can use this code::
>
> public bool WaitforMotionComplete(int timeout)
> {
> try
> {
> Stopwatch sw = new Stopwatch();
> string value = "";
> bool success = false;
> int val = -1;
> bool istimedout = false;
> sw.Start();
> while (val != 1)
> {
>
> value = _Controller.WriteLineReadLine(String.Format("CheckDone{0}", _ID));
>
> success = Int32.TryParse(value, out val);
> if (!success)
> {
> throw new Exception(String.Format("Bad return value for [CheckDone] function in axis {0} :: value = {1}", _Name, val));
> }
> if (timeout >= 0)//Determines whether or not to check for a timeout condition
> {
> if (timeout < sw.ElapsedMilliseconds)
> {
> istimedout = true;
> break;
> }
> }
> Thread.Sleep(30); //This should be optimized to make sure we do not clog USB traffic
> }
> return val == 1 & !istimedout;
> }
> catch (Exception ex)
> {
> throw new Exception(String.Format("Problem checking if axis is done [{0}]", _Name), ex);
> }
> }
>
>
>
> -Brad Murry
>
Group: DynoMotion Message: 3419 From: Tom Kerekes Date: 1/25/2012
Subject: Re: KM_Axis not updated
Hi Ray,
 
I'm working on that error message callback stuff.  It is very messy.  After that I plan to make at least an intermediate release.
 
Regards
TK